//
// Created by shen on 7/12/2024.
//

#ifndef TSAVPLAYER_AVQUEUE_H
#define TSAVPLAYER_AVQUEUE_H
#include "queue"
extern "C"{
#include "libavutil/avutil.h"
#include "libavcodec/avcodec.h"
};
class AVQueue {
public:
    //存储未解码的数据
    std::queue<AVPacket *> queuePacket;

    //互斥锁
    pthread_mutex_t  mutePacket;

    //条件锁
    pthread_cond_t condPacket;

    bool playStatus= false;

public:
    AVQueue();

    ~AVQueue();

    int push(AVPacket *avPacket);

    int get(AVPacket *packet);

    int size();

    void clearAvpacket();

    int putAvpacket(AVPacket  *packet);
    int getQueueSize();

    int getAvpacket(AVPacket  *packet);
};


#endif //TSAVPLAYER_AVQUEUE_H
